package io.lkt.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.lkt.common.utils.PageUtils;
import io.lkt.common.utils.Query;
import io.lkt.commons.dynamic.datasource.annotation.DataSource;
import io.lkt.modules.sys.dao.BArticleTempLogDao;
import io.lkt.modules.sys.entity.BArticleTempLogEntity;
import io.lkt.modules.sys.service.BArticleTempLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("bArticleTempLogService")
public class BArticleTempLogServiceImpl extends ServiceImpl<BArticleTempLogDao, BArticleTempLogEntity> implements BArticleTempLogService {
    @Autowired
    BArticleTempLogDao bArticleTempLogDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<BArticleTempLogEntity> page = this.page(
                new Query<BArticleTempLogEntity>().getPage(params),
                new QueryWrapper<BArticleTempLogEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    @DataSource("master")
    public boolean save(BArticleTempLogEntity entity) {
        return this.retBool(bArticleTempLogDao.insert(entity));
    }

}
